﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Micronet.OpenWeb.Utils;

namespace Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenPersonality
{
    public partial class LastNamesEdit : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)

        {
            if ("ID".OwQsIsExist())
            {
                  LastNameDv.DefaultMode= DetailsViewMode.Edit;
            }
            else
            {
                LastNameDv.DefaultMode = DetailsViewMode.Insert;
            }

            LastNameOds.Inserted += new ObjectDataSourceStatusEventHandler(LastNameOds_Inserted);
            LastNameOds.Deleted += new ObjectDataSourceStatusEventHandler(LastNameOds_Deleted);
            LastNameOds.Updated += new ObjectDataSourceStatusEventHandler(LastNameOds_Updated);

        }

        void LastNameOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("LastNamesAdmin.aspx");
        }

        void LastNameOds_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("LastNamesAdmin.aspx");

        }

        void LastNameOds_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("LastNamesAdmin.aspx");

        }
    }
}